package com.ruoyi.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.BasisRealSignal;
import com.ruoyi.mapper.BasisRealSignalMapper;
import com.ruoyi.service.IBasisRealSignalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 真实模采信号Service业务层处理
 * 
 * @author wangzebing
 * @date 2025-03-27
 */
@Service
public class BasisRealSignalServiceImpl implements IBasisRealSignalService
{
    @Autowired
    private BasisRealSignalMapper basisRealSignalMapper;

    /**
     * 查询真实模采信号
     * 
     * @param id 真实模采信号主键
     * @return 真实模采信号
     */
    @Override
    public BasisRealSignal selectBasisRealSignalById(Long id)
    {
        return basisRealSignalMapper.selectBasisRealSignalById(id);
    }

    /**
     * 查询真实模采信号列表
     * 
     * @param basisRealSignal 真实模采信号
     * @return 真实模采信号
     */
    @Override
    public List<BasisRealSignal> selectBasisRealSignalList(BasisRealSignal basisRealSignal)
    {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        basisRealSignal.setUserId(user.getUserId());
        return basisRealSignalMapper.selectBasisRealSignalList(basisRealSignal);
    }

    /**
     * 新增真实模采信号
     * 
     * @param basisRealSignal 真实模采信号
     * @return 结果
     */
    @Override
    public int insertBasisRealSignal(BasisRealSignal basisRealSignal)
    {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        basisRealSignal.setUserId(user.getUserId());
        basisRealSignal.setCreateTime(new Date());
        return basisRealSignalMapper.insertBasisRealSignal(basisRealSignal);
    }

    /**
     * 修改真实模采信号
     * 
     * @param basisRealSignal 真实模采信号
     * @return 结果
     */
    @Override
    public int updateBasisRealSignal(BasisRealSignal basisRealSignal)
    {
        return basisRealSignalMapper.updateBasisRealSignal(basisRealSignal);
    }

    /**
     * 批量删除真实模采信号
     * 
     * @param ids 需要删除的真实模采信号主键
     * @return 结果
     */
    @Override
    public int deleteBasisRealSignalByIds(Long[] ids)
    {
        return basisRealSignalMapper.deleteBasisRealSignalByIds(ids);
    }

    /**
     * 删除真实模采信号信息
     * 
     * @param id 真实模采信号主键
     * @return 结果
     */
    @Override
    public int deleteBasisRealSignalById(Long id)
    {
        return basisRealSignalMapper.deleteBasisRealSignalById(id);
    }
}
